package com.gestion.abs.bll.impl;

import javax.transaction.TransactionManager;

import com.gestion.abs.bll.api.GestionAbsence;
import com.gestion.abs.bo.Absence;
import com.gestion.abs.dao.api.AbsenceDao;
import com.gestion.abs.exceptions.EntityNotFoundException;

public class GestionAbsenceImpl implements GestionAbsence{

	
	private AbsenceDao absenceDAO;
	
	private TransactionManager transactionManager;
	
	// ajouter une absence :
	
	public Absence addAbsence(Absence absence){
		return absenceDAO.create(absence);
	}
	// modifier
	public void updateAbsence(Absence absence){
		
		absenceDAO.update(absence);
	}
	//suprimer
	public void deleteAbsence(Long idAbsence){
		
		absenceDAO.delete(idAbsence);
	}
	//chercher:
	public Absence chercherAbsence(Long id) throws EntityNotFoundException{
		
		return absenceDAO.findById(id);
	}
	public AbsenceDao getAbsenceDAO() {
		return absenceDAO;
	}
	public void setAbsenceDAO(AbsenceDao absenceDAO) {
		this.absenceDAO = absenceDAO;
	}
	public TransactionManager getTransactionManager() {
		return transactionManager;
	}
	public void setTransactionManager(TransactionManager transactionManager) {
		this.transactionManager = transactionManager;
	}
	
	
	
}
